package com.emokili.ewa.frame.controller.v1;

import com.emokili.ewa.common.utils.R;
import com.emokili.ewa.core.frame.service.FrameService;
import com.emokili.ewa.core.frame.service.MemberFrameService;
import com.emokili.ewa.core.frame.service.MemberService;
import com.emokili.ewa.core.frame.vo.FrameVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("v1/frame")
public class FrameController {

    @Autowired
    private MemberFrameService memberFrameService;
    @Autowired
    private FrameService frameService;

    @RequestMapping("/bind/status/{serialNumber}")
    @ResponseBody
    public R getBindStatus(@PathVariable String serialNumber){
        memberFrameService.getBindStatus(serialNumber);
        return R.ok();
    }

    /**
     * 相框设置
     * @param frameVo
     * @return
     */
    @PostMapping("/settings")
    @ResponseBody
    public R settings(@RequestBody FrameVo frameVo){
        frameService.update(frameVo);
        return R.ok();
    }
}
